package com.woniu.common;

import com.woniu.enumeration.ResultCode;
import com.woniu.exception.BookBusinessException;

/**
 * 自定义断言
 * */
public class Assert {
    /**
     * 断言方法
     *
     * @param condition  如果条件成立则抛出异常
     * @param resultCode 异常错误码对象
     */
    public static void error(boolean condition, ResultCode resultCode) {
        if (condition) {
            throw new BookBusinessException(resultCode);
        }
    }



}
